package br.com.cardapiolivre.facades;

import br.com.cardapiolivre.entidades.Conta;
import br.com.cardapiolivre.persistencia.ContaDaoJpa;

public class GerenciarConta {

    private static GerenciarConta instance = null;
    private static ContaDaoJpa cdj = new ContaDaoJpa();
    
    public static GerenciarConta getInstance() {
        if (instance == null) {
            instance = new GerenciarConta();
        }
        return instance;
    }

    public boolean validarEmail(String email) throws Exception {
        
        if (cdj.verificarEmail(email)) {
            return false;
        } else {            
            return true;
        }
    }
    
    public void salvarConta(Conta c) throws Exception{
        cdj.salvar(c);
    
    }
}
